1. Field of Invention
The present invention relates to a method for analyzing errors in a program. More particularly, the present invention relates to a method for analyzing errors in a USB program by finding out the actual processing sequence of the USB source codes of the USB program.
2. Description of Related Art
A conventional debugging tool for testing Universal Serial Bus (USB) source codes only allows analyzing USB packets being sent and received from a USB port, but not analyzing how USB source codes are processed. For instance, when a testing operator detects that a USB device processes abnormally, the testing operator first gets some USB packets from the USB device and then determines whether these USB packets are abnormal. If these USB packets are determined as normal, the testing operator only can speculate errors of the USB source codes based on the detected abnormal condition. On the other hand, if these USB packets are determined to be abnormal, besides speculating errors of the USB source codes based on the abnormal condition thereby, the testing operator also looks for USB source code errors with an ICE (In Circuit Emulator) and verifies the source code errors.
Because the USB source codes of a USB procedure are processed in connection with time and the USB source codes thereof will continue to initiate timeout events of the related USB procedures after the CPU is called off to process, people are not able to find out what the actual sequences that the source codes of the USB program being executed is, and the incorrect source codes of the USB program if there are incorrect source codes. Thus, the testing operators consume a lot of time speculating about the cause of the source code abnormalities and still struggle to find out the actual processing sequence of how the USB source codes are processed.